﻿using DFGK_WMS.Model.DTO;
using DFGK_WMS.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.IRepository
{
    /// <summary>
    /// 物料
    /// </summary>
    public interface ITMaterialRepository : IBaseRepository<TMaterial>
    {
        /// <summary>
        /// 添加物料
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool AddMaterial(TMaterial m);

        /// <summary>
        /// 物料列表显示
        /// </summary>
        /// <param name="mname"></param>
        /// <param name="materialcategoryid"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<TMaterial> GetMaterialList(string mname, int materialcategoryid, int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// 删除物料
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        bool DelMaterial(int mid);

        /// <summary>
        /// 修改物料
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool UpdMaterial(TMaterial m);

        /// <summary>
        /// 根据主键获取对象
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        TMaterial GetMaterialById(int mid);

        /// <summary>
        /// 生成一个物料号
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        string GetMaterialCode(int mid);

        /// <summary>
        /// 导出物料管理
        /// </summary>
        /// <returns></returns>
        List<TMaterial> GetTMaterialExcel();

        /// <summary>
        /// 获取全部
        /// </summary>
        /// <returns></returns>
        List<TMaterial> GetAllMaterialList();

        /// <summary>
        /// 批量添加物料
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        bool AddMaterialList(List<TMaterial> list);

        List<MaterialDTO> GetMaterialByInv(string name, int pageIndex, int pageSize, out int totalCount);
        bool Addlistpliang();

        /// <summary>
        /// 物料下传
        /// </summary>
        /// <returns></returns>
        bool MaterialDownload(List<TMaterialDto> materialDtos);
    }
}